powered by
Prediction with Cauchy naive Bayes classifier.
cauchynb.pred(xnew, location, scale, ni)
A numerical vector with 1, 2, ... denoting the predicted group.
A numerical matrix with new predictor variables whose group is to be predicted.
A matrix with the group location parameters of the Cauchy distribution. Each row corresponds to a group.
A matrix with the group scale parameters of the Cauchy distribution. Each row corresponds to a group.
A vector with the frequencies of each group.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Friedman J., Hastie T. and Tibshirani R. (2017). The elements of statistical learning. New York: Springer.
cauchy.nb, cv.cauchynb
x <- as.matrix(iris[, 1:4]) ina <- iris[, 5] a <- cauchy.nb(x, x, ina = ina) est <- cauchynb.pred(x, a$location, a$scale, a$ni) table(ina, est)
Run the code above in your browser using DataLab